<!-- <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本溢出</title>
    <style>
        .box{
            width: 300px;
            margin: 0 auto;
            text-align: left;
        }
        .one-line{
            border: 2px solid pink;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;                      
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="one-line">人们总是把幸福解读为“有”，有房，有车，有钱，有权，但幸福其实是“无”，无忧，无虑，无病，无灾，“有”多半是给别人看的，“无”才是你自的。</div>
    </div>
</body>
</html> -->



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多行文本溢出</title>
    <style>
        .box{
            width: 300px;
            margin: 0 auto;
            text-align: left;
            border: 2px solid pink;
        }
        .two-line{
            overflow: hidden;
            text-overflow: ellipsis;
            /* 将对象作为弹性伸缩盒子模型显示 */
            display: -webkit-box;
            /* 设置或检索伸缩盒对象的子元素的排列方式 */
            -webkit-box-orient: vertical;
            /* 行数，值可以改，表示展示x行后多余的伸缩展示 */
            -webkit-line-clamp: 2;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="two-line">
            土地是世界上唯一值得你去为之工作，为之战斗，为之牺牲的东西。 Land is the
            only thing in the world worth working for, worth fighting for, worth dying
            for.
        </div>
    </div>
</body>
</html>